import request from '@/utils/request'

// 查询列表
export function listWithPage(query) {
  return request({
    url: '/system/huoPin/page',
    method: 'get',
    params: query
  })
}

// 查询列表
export function listByPinLei(query) {
  return request({
    url: '/system/huoPin/listByPinLei',
    method: 'get',
    params: query
  })
}

// 查询列表
export function listByCangKu(query) {
  return request({
    url: '/system/huoPin/listByCangKu',
    method: 'get',
    params: query
  })
}


// 查询详细
export function getDetail(id) {
  return request({
    url: '/system/huoPin/' + id,
    method: 'get'
  })
}

// 新增
export function add(data) {
  return request({
    url: '/system/huoPin',
    method: 'post',
    data: data
  })
}

// 修改
export function update(data) {
  return request({
    url: '/system/huoPin',
    method: 'put',
    data: data
  })
}

export function changeGYS(ids, newGYSId){
  return request({
    url: '/system/huoPin/changeGYS',
    method: 'put',
    data: {
      ids,
      newGYSId
    }
  })
}

// 删除
export function del(id) {
  return request({
    url: '/system/huoPin/' + id,
    method: 'delete'
  })
}

